<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>菜单列表</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script language="javascript" src="${pageContext.request.contextPath}/script/jquery.js"></script>
    <script language="javascript" src="${pageContext.request.contextPath}/script/pageCommon.js" charset="utf-8"></script>
    <script language="javascript" src="${pageContext.request.contextPath}/script/PageUtils.js" charset="utf-8"></script>
    <script language="javascript" src="${pageContext.request.contextPath}/script/DemoData.js" charset="utf-8"></script>
	<script language="javascript" src="${pageContext.request.contextPath}/script/DataShowManager.js" charset="utf-8"></script>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/style/blue/pageCommon.css" />
    <script type="text/javascript">
    </script>
</head>
  
 <body>

<div id="Title_bar">
    <div id="Title_bar_Head"> 
        <div id="Title_Head"></div>
        <div id="Title"><!--页面标题-->
            <img border="0" width="13" height="13" src="${pageContext.request.contextPath}/style/images/title_arrow.gif"/> 岗位管理
        </div>
        <div id="Title_End"></div>
    </div>
</div>

<div id="MainArea">
    <table cellspacing="0" cellpadding="0" class="TableStyle">
       
        <!-- 表头-->
        <thead>
            <tr align=center valign=middle id=TableTitle>
                <td width="100">岗位名称</td>

                <td width="100">是否激活</td>
                <td>相关操作</td>
            </tr>
        </thead>
        
        <!--显示数据列表-->
        <tbody id="TableData">
        	<c:if test="${list!=null && list.size()>0 }">
        		<c:forEach items="${list }" var="e1">
        			<tr class="TableDetail1 template">
		                <td>${e1.roleName}&nbsp;</td>

		                <td>
		                	
			                	<c:choose>
			                		<c:when test="${e1.isactive==1 }">
			                			激活
			                		</c:when>
			                		<c:otherwise>
				                			禁用
			                		</c:otherwise>
			                	</c:choose>
		                	
		                </td>
		                <td>
		                	<!-- 
		                		如果当前记录是激活状态的，那么超链接就显示为禁用
		                	    如果当前记录是禁用状态的，那么超链接就显示为激活
		                	 -->
		                	 <c:choose>
			                		<c:when test="${e1.isactive==1 }">
			                		<a href="${pageContext.request.contextPath}/jsp/sys/role/roleServlet?opr=ban&&roleId=${e1.roleId}">
			                			禁用
			                		</a>
			                		</c:when>
			                		<c:otherwise>
			                			<a href="${pageContext.request.contextPath}/jsp/sys/role/roleServlet?opr=active&&roleId=${e1.roleId}">
				                			激活
				                		</a>
			                		</c:otherwise>
			                	</c:choose>
		                	<a href="${pageContext.request.contextPath}/jsp/sys/role/roleServlet?opr=delete&&roleId=${e1.roleId}">删除</a>
		                    <a href="${pageContext.request.contextPath}/jsp/sys/role/roleServlet?opr=update&&roleId=${e1.roleId}">修改</a>
		                    <a href="${pageContext.request.contextPath}/jsp/sys/role/roleServlet?opr=menu&&roleId=${e1.roleId}">设置权限</a>
							<a href="${pageContext.request.contextPath}/jsp/sys/role/roleServlet?opr=showuser&&roleId=${e1.roleId} }">查看当前岗位用户</a>
							 </td>
		            </tr>
        		</c:forEach>
        	</c:if>
        </tbody>
    </table>
    
 <div id=PageSelectorBar>
		<div id=PageSelectorMemo>
			页次：${pageBean.pageIndex }/${pageBean.pageCount }页 &nbsp;&nbsp;
			每页显示：${pageBean.pageSize }条 &nbsp;&nbsp;
			总记录数：${pageBean.totalCount }条 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<c:choose>
				<c:when test="${pageBean.pageIndex<=1&&pageBean.pageCount>1 }">
					<label>首页</label>&nbsp;&nbsp;
					<label>上一页</label>&nbsp;&nbsp;
					<a href="${pageContext.request.contextPath}/deptPoServlet?pageIndex=${pageBean.pageIndex+1 }" style="cursor: hand;color:blue;">下一页</a>&nbsp;&nbsp;
					<a href="${pageContext.request.contextPath}/deptPoServlet?pageIndex=${pageBean.pageCount }" style="cursor: hand;color:blue;">尾页</a>&nbsp;&nbsp;
				</c:when>
				<c:when test="${pageBean.pageIndex<pageBean.pageCount }">
					<a href="${pageContext.request.contextPath}/deptPoServlet?pageIndex=1" style="cursor: hand;color:blue;">首页</a> &nbsp;&nbsp;
					<a href="${pageContext.request.contextPath}/deptPoServlet?pageIndex=${pageBean.pageIndex-1 }" style="cursor: hand;color:blue;">上一页</a>&nbsp;&nbsp;
					<a href="${pageContext.request.contextPath}/deptPoServlet?pageIndex=${pageBean.pageIndex+1 }" style="cursor: hand;color:blue;">下一页</a>&nbsp;&nbsp;
					<a href="${pageContext.request.contextPath}/deptPoServlet?pageIndex=${pageBean.pageCount }" style="cursor: hand;color:blue;">尾页</a>&nbsp;&nbsp;
				</c:when>
				<c:when test="${pageBean.pageIndex==pageBean.pageCount&&pageBean.pageCount>1 }">
					<a href="${pageContext.request.contextPath}/deptPoServlet?pageIndex=1" style="cursor: hand;color:blue;">首页</a> &nbsp;&nbsp;
					<a href="${pageContext.request.contextPath}/deptPoServlet?pageIndex=${pageBean.pageIndex-1 }" style="cursor: hand;color:blue;">上一页</a>&nbsp;&nbsp;
					<label>下一页</label>&nbsp;&nbsp;
					<label>末页</label>&nbsp;&nbsp;
				</c:when>
				<c:otherwise>
					<label>首页</label>&nbsp;&nbsp;
					<label>上一页</label>&nbsp;&nbsp;
					<label>下一页</label>&nbsp;&nbsp;
					<label>末页</label>&nbsp;&nbsp;
				</c:otherwise>
			</c:choose>
			<c:choose>
				<c:when test="${pageBean.list.get(0).deptParent==null&&pageBean.list.get(0)!=null }">
					<label>返回上一级</label>&nbsp;&nbsp;
				</c:when>
				<c:otherwise>
					<a href="${pageContext.request.contextPath}/deptPoServlet?did=${grandpa }" style="cursor: hand;color:blue;">返回上一级</a>&nbsp;&nbsp;
				</c:otherwise>
			</c:choose>
		</div>
		<div id=PageSelectorSelectorArea>
		</div>
	</div>
    
    
    
    <!-- 其他功能超链接 -->
    <div id="TableTail">
        <div id="TableTail_inside">
        
            <a href="role_save.jsp"><img src="${pageContext.request.contextPath}/style/images/createNew.png" /></a>
        </div>
    </div>
</div>

</body>
</html>
